﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FindIt.Data;

namespace FindIt.Domain.Handlers.Digests {
    public class MarkAsDeleted {
        private readonly IDigestRepository _digestRepository;

        public MarkAsDeleted(IDigestRepository DigestRepository) {
            _digestRepository = DigestRepository;
        }

        public void Execute(Guid digestId) {
            var digest = _digestRepository.GetDigest(digestId);

            if (digest == null)
                throw new ArgumentNullException();

            digest.Deleted = true;
            _digestRepository.Update(digest);
        }

    }
}
